package cn.cycleif.admin.controller;

import cn.cycleif.admin.service.AdminAnswerService;
import cn.cycleif.util.R;
import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Date: 25/2/15-21:53
 * @Desc:
 */
@RestController
@RequestMapping("/sys/answer")
@Tag(name = "回答管理", description = "回答管理接口")
@SaCheckRole("staff")
public class AdminAnswerController {

  @Autowired
  private AdminAnswerService answerService;

  @Operation(summary = "接受回答")
  @PutMapping("/accept/{id}")
  public R<String> acceptAnswer(@PathVariable("id") Integer id) {
    return answerService.acceptAnswer(id);
  }

  @Operation(summary = "取消接受回答")
  @PutMapping("/cancel/{id}")
  public R<String> cancelAcceptAnswer(@PathVariable("id") Integer id) {
    return answerService.cancelAcceptAnswer(id);
  }
}
